Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development
lookupEntry event
On entry of the lookup field, the
enterlookupprocedure in the lookup support procedurelookup.ppublisheslookupEntrywith the following parameters:
A description of the parameters follows:
The handle of the lookup instance is useful when your viewer contains multiple lookups and you must determine which lookup caused your hook to fire.
To use this event, add a procedure to your viewer’s custom super procedure with the name
lookupEntryand the above parameters.Using PUBLISH and SUBSCRIBE properly in super procedures
In
initializeObjectin the super procedure supporting the lookup, before theRUNSUPERstatement, subscribe your viewer to the event using the following statement:
Note the format of this
SUBSCRIBEstatement carefully. It is essential that you always keep in mind that events should almost never be published by or directly subscribed to in super procedures. The super procedure acts in the background on behalf of application objects such as viewers. Thus aSUBSCRIBEstatement in a super procedure will normally be qualified byPROCEDURETARGET-PROCEDURE, meaning that the subscription is registered on behalf of the viewer or other object, not the super procedure itself. And the event will also be qualified byIN TARGET-PROCEDURE, meaning that the interpreter will respond when the event occurs in the viewer or other object, not in the super procedure. Likewise, aPUBLISHstatement in super procedure code should normally be in the following form:
In this way the interpreter responds to the event as if it had actually come from the supported SmartObject and not from the super procedure itself. Forgetting these forms can cause problems, such as when events do not seem to occur or are not responded to properly.
The
lookupEntryevent is used within the lookup super procedurelookup.pitself to save the current screen value of the lookup so that on leave of the lookup you can see if it has been programmatically changed and allow the standard lookup code to fire, validating the new value. Possible uses in application-specific code could be for programmatic manipulation of properties at run time, or possibly customization of the value based on the value of other fields on your viewer.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |